package com.heima.wemedia.feign;

import com.heima.apis.wemedia.IChannelClient;
import com.heima.model.common.dtos.ResponseResult;
import com.heima.model.wemedia.pojos.WmChannel;
import com.heima.wemedia.service.WmChannelService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
public class ChannelClient implements IChannelClient {

    @Autowired
    private WmChannelService wmChannelService;

    @GetMapping("/api/v1/wemedia/findChannels")
    public ResponseResult<List<WmChannel>> findChannels(){
        return wmChannelService.findAll();
    }
}
